import java.util.Scanner;
public class Arrayadd {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		char choose;
		int[] arr = {1,2,3};
		do{
		int[] arr2 = new int[arr.length + 1];
		for(int i = 0;i < arr.length + 1; i++){
			if(i < arr.length){
				arr2[i] = arr[i];
			}else{
				arr2[i] = scanner.nextInt();
			}
		}

		for(int i = 0; i < arr.length; i++){
			System.out.print(arr[i] + " ");
		}

		arr = arr2;
		System.out.println("是否继续输入y/n:");
		choose = scanner.next().charAt(0);
	    }while(choose == 'y');
	    System.out.println("你退出了扩容......");
	}
}